//
//  ViewController.swift
//  JLUIKit
//
//  Created by JiangChencheng on 08/02/2024.
//  Copyright (c) 2024 JiangChencheng. All rights reserved.
//

import UIKit
import OSLog
import JLUIKit
import Kingfisher
import libpag


class ViewController: UIViewController {

    lazy var label: JLStrokeLabel = {
        let lbl = JLStrokeLabel(frame: CGRectMake(20, 100, 100, 100))
        lbl.strokeColor = .red
        lbl.strokeWidth = 0.5;
        lbl.text = "39摄氏度"
        lbl.textColor = .black
        return lbl
    }()
    
    lazy var pagView: PAGView = {
        let pagView = PAGView(frame: CGRect(x: 60, y: 200, width: 80, height: 80))
        pagView.setRepeatCount(-1)
        return pagView
    }()
    
    lazy var pagImageView: PAGImageView = {
        let pagImageView = PAGImageView(frame: CGRect(x: 60, y: 400, width: 80, height: 80))
        pagImageView.contentMode = .scaleAspectFit
        pagImageView.setRepeatCount(-1)
        return pagImageView
    }()
    
    lazy var collectionView: JLCollectionView = {
        let layout = UICollectionViewFlowLayout()
        let collectionView = JLCollectionView(frame: .zero, collectionViewLayout: layout)
        collectionView.register(DemoCollectionViewCell.self)
        return collectionView
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        
        let pagURL = "https://static.mimi-live.com/uploads/d6481103abaf7ad251ee18c6932ae3e11723460112.pag"
        
        view.addSubview(pagView)
        pagView.jl_setPag(with: pagURL)
        
        view.addSubview(pagImageView)
        pagImageView.jl_setPag(with: pagURL, placeholder: UIImage(systemName: "square.and.arrow.up"))
    }
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

